import QilinView from "./QilinView/index.vue";
import QilinSearch from "./QilinSearch/index.vue";
import QilinUploadFile from "./QilinUploadFile/index.vue";
import QilinUploadImage from "./QilinUploadImage/index.vue";
import QilinDialog from "./QilinDialog/index.vue";
import QilinForm from "./QilinForm/index.vue";
import QilinTable from "./QilinTable/index.vue";
import ColumnTable from "./QilinTable/table-column.vue";

import number from "./directive/number/index.js";

const components = [
    QilinView,
    QilinSearch,
    QilinUploadFile,
    QilinUploadImage,
    QilinDialog,
    QilinForm,
    QilinTable,
    ColumnTable
];

const directives = [
    number
]

const install = (Vue)=>{
    components.forEach((item)=>{
        Vue.component(item.name,item);
    });
    directives.forEach((item)=>{
        Vue.directive(item.name,item);
    });
};

// 判断是否是直接引入的文件即script导入的，是就不用调用Vue.use()
if(typeof window !== "undefined" && window.Vue){
    install(window.Vue);
};

export default {
    install
};